{
 "cells": [
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "# 常用Linux命令\n",
    "\n",
    "在与服务器进行交互的时候，不可避免地要掌握一些Linux命令，现记录如下："
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 文件相关\n",
    "\n",
    "### 查找某个指定的文件\n",
    "\n",
    "当我们只知道文件名，但是不知道文件的确切位置时，可以通过下面的命令查找："
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "/home/notebook/push.sh\r\n"
     ]
    }
   ],
   "source": [
    "!find / -name push.sh"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 列出文件目录\n",
    "\n",
    "列出文件目录的操作非常灵活。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "d3\t    jupyter.ipynb\tnode_modules\t   push.sh\r\n",
      "error.log   jupyter.log\t\tpackage.json\t   Untitled2.ipynb\r\n",
      "javascript  LinuxCommand.ipynb\tpackage-lock.json\r\n"
     ]
    }
   ],
   "source": [
    "!ls"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "## 系统相关\n",
    "\n",
    "### 查看硬盘空间占用情况\n",
    "\n",
    "df 命令可以显示所有的文件系统。 "
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 4,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: df [OPTION]... [FILE]...\r\n",
      "Show information about the file system on which each FILE resides,\r\n",
      "or all file systems by default.\r\n",
      "\r\n",
      "Mandatory arguments to long options are mandatory for short options too.\r\n",
      "  -a, --all             include pseudo, duplicate, inaccessible file systems\r\n",
      "  -B, --block-size=SIZE  scale sizes by SIZE before printing them; e.g.,\r\n",
      "                           '-BM' prints sizes in units of 1,048,576 bytes;\r\n",
      "                           see SIZE format below\r\n",
      "  -h, --human-readable  print sizes in powers of 1024 (e.g., 1023M)\r\n",
      "  -H, --si              print sizes in powers of 1000 (e.g., 1.1G)\r\n",
      "  -i, --inodes          list inode information instead of block usage\r\n",
      "  -k                    like --block-size=1K\r\n",
      "  -l, --local           limit listing to local file systems\r\n",
      "      --no-sync         do not invoke sync before getting usage info (default)\r\n",
      "      --output[=FIELD_LIST]  use the output format defined by FIELD_LIST,\r\n",
      "                               or print all fields if FIELD_LIST is omitted.\r\n",
      "  -P, --portability     use the POSIX output format\r\n",
      "      --sync            invoke sync before getting usage info\r\n",
      "      --total           elide all entries insignificant to available space,\r\n",
      "                          and produce a grand total\r\n",
      "  -t, --type=TYPE       limit listing to file systems of type TYPE\r\n",
      "  -T, --print-type      print file system type\r\n",
      "  -x, --exclude-type=TYPE   limit listing to file systems not of type TYPE\r\n",
      "  -v                    (ignored)\r\n",
      "      --help     display this help and exit\r\n",
      "      --version  output version information and exit\r\n",
      "\r\n",
      "Display values are in units of the first available SIZE from --block-size,\r\n",
      "and the DF_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\r\n",
      "Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\r\n",
      "\r\n",
      "The SIZE argument is an integer and optional unit (example: 10K is 10*1024).\r\n",
      "Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).\r\n",
      "\r\n",
      "FIELD_LIST is a comma-separated list of columns to be included.  Valid\r\n",
      "field names are: 'source', 'fstype', 'itotal', 'iused', 'iavail', 'ipcent',\r\n",
      "'size', 'used', 'avail', 'pcent', 'file' and 'target' (see info page).\r\n",
      "\r\n",
      "GNU coreutils online help: <http://www.gnu.org/software/coreutils/>\r\n",
      "Full documentation at: <http://www.gnu.org/software/coreutils/df>\r\n",
      "or available locally via: info '(coreutils) df invocation'\r\n"
     ]
    }
   ],
   "source": [
    "!df --help"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 3,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Filesystem      Size  Used Avail Use% Mounted on\r\n",
      "udev            2.0G     0  2.0G   0% /dev\r\n",
      "tmpfs           395M  6.1M  389M   2% /run\r\n",
      "/dev/vda1        20G   11G  8.2G  56% /\r\n",
      "tmpfs           2.0G     0  2.0G   0% /dev/shm\r\n",
      "tmpfs           5.0M     0  5.0M   0% /run/lock\r\n",
      "tmpfs           2.0G     0  2.0G   0% /sys/fs/cgroup\r\n",
      "/dev/vdb1        50G  7.7G   39G  17% /home\r\n",
      "tmpfs           395M     0  395M   0% /run/user/0\r\n",
      "overlay          20G   11G  8.2G  56% /var/lib/docker/overlay2/850875068d609a39652d1ad88e01aec0a22de910f6ce5e211cf73a01dca1ed8d/merged\r\n"
     ]
    }
   ],
   "source": [
    "!df -h"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 查看运行的进程\n",
    "\n",
    "ps命令可以用来查看进程"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 5,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "\r\n",
      "Usage:\r\n",
      " ps [options]\r\n",
      "\r\n",
      " Try 'ps --help <simple|list|output|threads|misc|all>'\r\n",
      "  or 'ps --help <s|l|o|t|m|a>'\r\n",
      " for additional help text.\r\n",
      "\r\n",
      "For more details see ps(1).\r\n"
     ]
    }
   ],
   "source": [
    "!ps --help"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 8,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "USER       PID %CPU %MEM    VSZ   RSS TTY      STAT START   TIME COMMAND\r\n",
      "root         1  0.0  0.2  77560  8728 ?        Ss   08:57   0:01 /sbin/init noib\r\n",
      "root         2  0.0  0.0      0     0 ?        S    08:57   0:00 [kthreadd]\r\n",
      "root         4  0.0  0.0      0     0 ?        I<   08:57   0:00 [kworker/0:0H]\r\n",
      "root         6  0.0  0.0      0     0 ?        I<   08:57   0:00 [mm_percpu_wq]\r\n",
      "root         7  0.0  0.0      0     0 ?        S    08:57   0:00 [ksoftirqd/0]\r\n",
      "root         8  0.0  0.0      0     0 ?        I    08:57   0:00 [rcu_sched]\r\n",
      "root         9  0.0  0.0      0     0 ?        I    08:57   0:00 [rcu_bh]\r\n",
      "root        10  0.0  0.0      0     0 ?        S    08:57   0:00 [migration/0]\r\n",
      "root        11  0.0  0.0      0     0 ?        S    08:57   0:00 [watchdog/0]\r\n",
      "root        12  0.0  0.0      0     0 ?        S    08:57   0:00 [cpuhp/0]\r\n",
      "root        13  0.0  0.0      0     0 ?        S    08:57   0:00 [cpuhp/1]\r\n",
      "root        14  0.0  0.0      0     0 ?        S    08:57   0:00 [watchdog/1]\r\n",
      "root        15  0.0  0.0      0     0 ?        S    08:57   0:00 [migration/1]\r\n",
      "root        16  0.0  0.0      0     0 ?        S    08:57   0:00 [ksoftirqd/1]\r\n",
      "root        17  0.0  0.0      0     0 ?        I    08:57   0:00 [kworker/1:0]\r\n",
      "root        18  0.0  0.0      0     0 ?        I<   08:57   0:00 [kworker/1:0H]\r\n",
      "root        19  0.0  0.0      0     0 ?        S    08:57   0:00 [kdevtmpfs]\r\n",
      "root        20  0.0  0.0      0     0 ?        I<   08:57   0:00 [netns]\r\n",
      "root        21  0.0  0.0      0     0 ?        S    08:57   0:00 [rcu_tasks_kthr\r\n",
      "root        22  0.0  0.0      0     0 ?        S    08:57   0:00 [kauditd]\r\n",
      "root        23  0.0  0.0      0     0 ?        I    08:57   0:00 [kworker/1:1]\r\n",
      "root        24  0.0  0.0      0     0 ?        I    08:57   0:00 [kworker/0:1]\r\n",
      "root        25  0.0  0.0      0     0 ?        S    08:57   0:00 [khungtaskd]\r\n",
      "root        26  0.0  0.0      0     0 ?        S    08:57   0:00 [oom_reaper]\r\n",
      "root        27  0.0  0.0      0     0 ?        I<   08:57   0:00 [writeback]\r\n",
      "root        28  0.0  0.0      0     0 ?        S    08:57   0:00 [kcompactd0]\r\n",
      "root        29  0.0  0.0      0     0 ?        SN   08:57   0:00 [ksmd]\r\n",
      "root        30  0.0  0.0      0     0 ?        SN   08:57   0:00 [khugepaged]\r\n",
      "root        31  0.0  0.0      0     0 ?        I<   08:57   0:00 [crypto]\r\n",
      "root        32  0.0  0.0      0     0 ?        I<   08:57   0:00 [kintegrityd]\r\n",
      "root        33  0.0  0.0      0     0 ?        I<   08:57   0:00 [kblockd]\r\n",
      "root        34  0.0  0.0      0     0 ?        I<   08:57   0:00 [ata_sff]\r\n",
      "root        35  0.0  0.0      0     0 ?        I<   08:57   0:00 [md]\r\n",
      "root        36  0.0  0.0      0     0 ?        I<   08:57   0:00 [edac-poller]\r\n",
      "root        37  0.0  0.0      0     0 ?        I<   08:57   0:00 [devfreq_wq]\r\n",
      "root        38  0.0  0.0      0     0 ?        I<   08:57   0:00 [watchdogd]\r\n",
      "root        41  0.0  0.0      0     0 ?        S    08:57   0:00 [kswapd0]\r\n",
      "root        42  0.0  0.0      0     0 ?        I<   08:57   0:00 [kworker/u5:0]\r\n",
      "root        43  0.0  0.0      0     0 ?        S    08:57   0:00 [ecryptfs-kthre\r\n",
      "root        85  0.0  0.0      0     0 ?        I<   08:57   0:00 [kthrotld]\r\n",
      "root        86  0.0  0.0      0     0 ?        I<   08:57   0:00 [acpi_thermal_p\r\n",
      "root        87  0.0  0.0      0     0 ?        S    08:57   0:00 [scsi_eh_0]\r\n",
      "root        88  0.0  0.0      0     0 ?        I<   08:57   0:00 [scsi_tmf_0]\r\n",
      "root        89  0.0  0.0      0     0 ?        S    08:57   0:00 [scsi_eh_1]\r\n",
      "root        90  0.0  0.0      0     0 ?        I<   08:57   0:00 [scsi_tmf_1]\r\n",
      "root        96  0.0  0.0      0     0 ?        I<   08:57   0:00 [ipv6_addrconf]\r\n",
      "root       105  0.0  0.0      0     0 ?        I<   08:57   0:00 [kstrp]\r\n",
      "root       122  0.0  0.0      0     0 ?        I<   08:57   0:00 [charger_manage\r\n",
      "root       173  0.0  0.0      0     0 ?        I<   08:57   0:00 [kworker/0:1H]\r\n",
      "root       193  0.0  0.0      0     0 ?        S    08:57   0:00 [jbd2/vda1-8]\r\n",
      "root       194  0.0  0.0      0     0 ?        I<   08:57   0:00 [ext4-rsv-conve\r\n",
      "root       234  0.0  0.5  94116 22376 ?        S<s  08:57   0:00 /lib/systemd/sy\r\n",
      "root       266  0.0  0.1  45752  4688 ?        Ss   08:57   0:00 /lib/systemd/sy\r\n",
      "root       279  0.0  0.0      0     0 ?        I<   08:57   0:00 [kworker/1:1H]\r\n",
      "systemd+   280  0.0  0.1  71860  5268 ?        Ss   08:57   0:00 /lib/systemd/sy\r\n",
      "root       302  0.0  0.0      0     0 ?        S    08:57   0:00 [jbd2/vdb1-8]\r\n",
      "root       303  0.0  0.0      0     0 ?        I<   08:57   0:00 [ext4-rsv-conve\r\n",
      "systemd+   317  0.0  0.1  70768  6156 ?        Ss   08:57   0:00 /lib/systemd/sy\r\n",
      "root       348  0.0  0.0      0     0 ?        I<   08:57   0:00 [ttm_swap]\r\n",
      "daemon     404  0.0  0.0  28332  2492 ?        Ss   08:57   0:00 /usr/sbin/atd -\r\n",
      "root       406  0.0  0.1 287548  6988 ?        Ssl  08:57   0:00 /usr/lib/accoun\r\n",
      "root       407  0.0  0.4 170488 17348 ?        Ssl  08:57   0:00 /usr/bin/python\r\n",
      "syslog     409  0.0  0.1 263040  4468 ?        Ssl  08:57   0:00 /usr/sbin/rsysl\r\n",
      "root       410  0.0  0.0  31320  3320 ?        Ss   08:57   0:00 /usr/sbin/cron \r\n",
      "message+   411  0.0  0.1  50052  4392 ?        Ss   08:57   0:00 /usr/bin/dbus-d\r\n",
      "root       427  0.0  0.1  70580  6020 ?        Ss   08:57   0:00 /lib/systemd/sy\r\n",
      "root       447  0.0  1.0 907932 41648 ?        Ssl  08:57   0:01 /usr/bin/contai\r\n",
      "root       479  0.0  0.0  15956  2412 ttyS0    Ss+  08:57   0:00 /sbin/agetty -o\r\n",
      "root       483  0.0  0.0  16180  1892 tty1     Ss+  08:57   0:00 /sbin/agetty -o\r\n",
      "root       490  0.0  0.1  33228  5300 ?        Ssl  08:57   0:01 /usr/local/aegi\r\n",
      "_chrony    514  0.0  0.0 105692  3132 ?        S    08:57   0:00 /usr/sbin/chron\r\n",
      "root       528  0.0  0.5 187232 20204 ?        Ssl  08:57   0:00 /usr/bin/python\r\n",
      "root       529  0.0  0.1  72300  5696 ?        Ss   08:57   0:00 /usr/sbin/sshd \r\n",
      "root       583  0.0  0.0 141120  1612 ?        Ss   08:57   0:00 nginx: master p\r\n",
      "www-data   584  0.0  0.1 143820  6232 ?        S    08:57   0:00 nginx: worker p\r\n",
      "www-data   585  0.0  0.1 144112  7324 ?        S    08:57   0:00 nginx: worker p\r\n",
      "root       682  0.0  2.0 904976 82768 ?        Ssl  08:57   0:00 /usr/bin/docker\r\n",
      "root       683  0.0  0.1  32628  4480 ?        Ssl  08:57   0:01 /usr/sbin/aliyu\r\n",
      "root      1017  1.0  0.3 131036 15824 ?        S<sl 08:57   0:23 /usr/local/aegi\r\n",
      "root      1047  0.0  0.1 108352  7440 ?        Ss   08:57   0:00 sshd: root@pts/\r\n",
      "root      1058  0.0  0.1  76660  7236 ?        Ss   08:57   0:00 /lib/systemd/sy\r\n",
      "root      1070  0.0  0.0 109244  2240 ?        S    08:57   0:00 (sd-pam)\r\n",
      "root      1121  0.0  0.1  22648  5152 pts/0    Ss+  08:57   0:00 -bash\r\n",
      "root      1149  0.1  1.6 388204 66316 pts/0    Sl   08:57   0:03 /root/anaconda3\r\n",
      "root      1519  0.0  1.1 532064 47448 ?        Ssl  09:10   0:00 /root/anaconda3\r\n",
      "root      1533  0.0  1.1 540656 48460 ?        Ssl  09:10   0:00 /root/anaconda3\r\n",
      "root      1547  0.0  0.0      0     0 ?        I    09:13   0:00 [kworker/u4:0]\r\n",
      "root      1556  0.0  0.0      0     0 ?        I    09:13   0:00 [kworker/0:0]\r\n",
      "root      1590  0.0  0.0      0     0 ?        I    09:29   0:00 [kworker/u4:2]\r\n",
      "root      1599  0.0  0.0      0     0 ?        I    09:34   0:00 [kworker/u4:1]\r\n",
      "root      1603  0.0  0.0   4628   872 pts/1    Ss+  09:35   0:00 /bin/sh -c ps a\r\n",
      "root      1604  0.0  0.0  37368  3264 pts/1    R+   09:35   0:00 ps aux\r\n"
     ]
    }
   ],
   "source": [
    "!ps aux"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 查看文件所占大小\n",
    "\n",
    "如果当前目录下文件和文件夹很多，使用du的命令，可以循环列出所有文件和文件夹所使用的空间。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 9,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Usage: du [OPTION]... [FILE]...\r\n",
      "  or:  du [OPTION]... --files0-from=F\r\n",
      "Summarize disk usage of the set of FILEs, recursively for directories.\r\n",
      "\r\n",
      "Mandatory arguments to long options are mandatory for short options too.\r\n",
      "  -0, --null            end each output line with NUL, not newline\r\n",
      "  -a, --all             write counts for all files, not just directories\r\n",
      "      --apparent-size   print apparent sizes, rather than disk usage; although\r\n",
      "                          the apparent size is usually smaller, it may be\r\n",
      "                          larger due to holes in ('sparse') files, internal\r\n",
      "                          fragmentation, indirect blocks, and the like\r\n",
      "  -B, --block-size=SIZE  scale sizes by SIZE before printing them; e.g.,\r\n",
      "                           '-BM' prints sizes in units of 1,048,576 bytes;\r\n",
      "                           see SIZE format below\r\n",
      "  -b, --bytes           equivalent to '--apparent-size --block-size=1'\r\n",
      "  -c, --total           produce a grand total\r\n",
      "  -D, --dereference-args  dereference only symlinks that are listed on the\r\n",
      "                          command line\r\n",
      "  -d, --max-depth=N     print the total for a directory (or file, with --all)\r\n",
      "                          only if it is N or fewer levels below the command\r\n",
      "                          line argument;  --max-depth=0 is the same as\r\n",
      "                          --summarize\r\n",
      "      --files0-from=F   summarize disk usage of the\r\n",
      "                          NUL-terminated file names specified in file F;\r\n",
      "                          if F is -, then read names from standard input\r\n",
      "  -H                    equivalent to --dereference-args (-D)\r\n",
      "  -h, --human-readable  print sizes in human readable format (e.g., 1K 234M 2G)\r\n",
      "      --inodes          list inode usage information instead of block usage\r\n",
      "  -k                    like --block-size=1K\r\n",
      "  -L, --dereference     dereference all symbolic links\r\n",
      "  -l, --count-links     count sizes many times if hard linked\r\n",
      "  -m                    like --block-size=1M\r\n",
      "  -P, --no-dereference  don't follow any symbolic links (this is the default)\r\n",
      "  -S, --separate-dirs   for directories do not include size of subdirectories\r\n",
      "      --si              like -h, but use powers of 1000 not 1024\r\n",
      "  -s, --summarize       display only a total for each argument\r\n",
      "  -t, --threshold=SIZE  exclude entries smaller than SIZE if positive,\r\n",
      "                          or entries greater than SIZE if negative\r\n",
      "      --time            show time of the last modification of any file in the\r\n",
      "                          directory, or any of its subdirectories\r\n",
      "      --time=WORD       show time as WORD instead of modification time:\r\n",
      "                          atime, access, use, ctime or status\r\n",
      "      --time-style=STYLE  show times using STYLE, which can be:\r\n",
      "                            full-iso, long-iso, iso, or +FORMAT;\r\n",
      "                            FORMAT is interpreted like in 'date'\r\n",
      "  -X, --exclude-from=FILE  exclude files that match any pattern in FILE\r\n",
      "      --exclude=PATTERN    exclude files that match PATTERN\r\n",
      "  -x, --one-file-system    skip directories on different file systems\r\n",
      "      --help     display this help and exit\r\n",
      "      --version  output version information and exit\r\n",
      "\r\n",
      "Display values are in units of the first available SIZE from --block-size,\r\n",
      "and the DU_BLOCK_SIZE, BLOCK_SIZE and BLOCKSIZE environment variables.\r\n",
      "Otherwise, units default to 1024 bytes (or 512 if POSIXLY_CORRECT is set).\r\n",
      "\r\n",
      "The SIZE argument is an integer and optional unit (example: 10K is 10*1024).\r\n",
      "Units are K,M,G,T,P,E,Z,Y (powers of 1024) or KB,MB,... (powers of 1000).\r\n",
      "\r\n",
      "GNU coreutils online help: <http://www.gnu.org/software/coreutils/>\r\n",
      "Full documentation at: <http://www.gnu.org/software/coreutils/du>\r\n",
      "or available locally via: info '(coreutils) du invocation'\r\n"
     ]
    }
   ],
   "source": [
    "!du --help"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 15,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "136K\t/root/.jupyter\n",
      "14M\t/root/.cache\n",
      "8.0K\t/root/.gnupg\n",
      "16K\t/root/.config\n",
      "136K\t/root/.local\n",
      "68K\t/root/.ipython\n",
      "8.0K\t/root/.pip\n",
      "38M\t/root/.npm\n",
      "8.0K\t/root/.conda\n",
      "3.8G\t/root/anaconda3\n",
      "17M\t/root/lib\n",
      "4.0K\t/root/bin\n",
      "20K\t/root/.ssh\n",
      "3.9G\t/root\n"
     ]
    }
   ],
   "source": [
    "!du -h --max-depth=1 /root"
   ]
  },
  {
   "cell_type": "markdown",
   "metadata": {},
   "source": [
    "### 定时任务\n",
    "\n",
    "crontab 命令能查看、编辑定时任务。"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 16,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "crontab: invalid option -- '-'\r\n",
      "crontab: usage error: unrecognized option\r\n",
      "usage:\tcrontab [-u user] file\r\n",
      "\tcrontab [ -u user ] [ -i ] { -e | -l | -r }\r\n",
      "\t\t(default operation is replace, per 1003.2)\r\n",
      "\t-e\t(edit user's crontab)\r\n",
      "\t-l\t(list user's crontab)\r\n",
      "\t-r\t(delete user's crontab)\r\n",
      "\t-i\t(prompt before deleting user's crontab)\r\n"
     ]
    }
   ],
   "source": [
    "!crontab --help"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 1,
   "metadata": {
    "collapsed": true
   },
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "# Edit this file to introduce tasks to be run by cron.\r\n",
      "# \r\n",
      "# Each task to run has to be defined through a single line\r\n",
      "# indicating with different fields when the task will be run\r\n",
      "# and what command to run for the task\r\n",
      "# \r\n",
      "# To define the time you can provide concrete values for\r\n",
      "# minute (m), hour (h), day of month (dom), month (mon),\r\n",
      "# and day of week (dow) or use '*' in these fields (for 'any').# \r\n",
      "# Notice that tasks will be started based on the cron's system\r\n",
      "# daemon's notion of time and timezones.\r\n",
      "# \r\n",
      "# Output of the crontab jobs (including errors) is sent through\r\n",
      "# email to the user the crontab file belongs to (unless redirected).\r\n",
      "# \r\n",
      "# For example, you can run a backup of all your user accounts\r\n",
      "# at 5 a.m every week with:\r\n",
      "# 0 5 * * 1 tar -zcf /var/backups/home.tgz /home/\r\n",
      "# \r\n",
      "# For more information see the manual pages of crontab(5) and cron(8)\r\n",
      "# \r\n",
      "# m h  dom mon dow   command\r\n",
      "* 7 * * * /home/notebook/push.sh\r\n"
     ]
    }
   ],
   "source": [
    "!crontab -l"
   ]
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 3",
   "language": "python",
   "name": "python3"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 3
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython3",
   "version": "3.7.6"
  },
  "toc": {
   "base_numbering": 1,
   "nav_menu": {
    "height": "194px",
    "width": "191px"
   },
   "number_sections": true,
   "sideBar": true,
   "skip_h1_title": false,
   "title_cell": "Table of Contents",
   "title_sidebar": "Contents",
   "toc_cell": false,
   "toc_position": {},
   "toc_section_display": true,
   "toc_window_display": false
  }
 },
 "nbformat": 4,
 "nbformat_minor": 4
}
